package org.softwarer.framework.web;

public class ResultResponse <DataType>{

    private int code;

    private String message;

    private DataType data;


    public static ResultResponse<Boolean> message(String message){
        return new ResultResponse<>(200, message, true);
    }

    public static<DataType> ResultResponse<DataType> success(DataType data){
        return new ResultResponse<>(200, "操作成功！", data);
    }

    private ResultResponse(int code, String message, DataType data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public DataType getData() {
        return data;
    }

    public void setData(DataType data) {
        this.data = data;
    }
}
